package com.foreknow.homework;

public class rule {
    public void bisai(){
        person person = new person();
        Computer computer = new Computer();
        int shuying = 0;
        if (computer.chuquan().equals(person.getJieguo())){
            shuying = 3;
        }else if (computer.chuquan().equals("剪刀")){
            if (person.getJieguo().equals("布")){
                shuying = 1;
            }else {
                shuying = 2;
            }
        }else if (computer.chuquan().equals("石头")){
            if (person.getJieguo().equals("剪刀")){
                shuying = 1;
            }else{
                shuying = 2;
            }
        }else if (computer.chuquan().equals("布")){
            if (person.getJieguo().equals("石头")){
                shuying = 1;
            }else {
                shuying = 2;
            }
        }
        if (shuying == 1){
            System.out.println("你输了！");
        } else if (shuying == 2){
            System.out.println("你赢了!");
        } else if (shuying == 3){
            System.out.println("平局");
        }
    }
}
